//---------------------------------------------------------------------------


#pragma hdrstop

#include "TElement.h"

//---------------------------------------------------------------------------

#pragma package(smart_init)
__fastcall TElements::TElements()
{

}

TElements & __fastcall TElements::operator = (const TElements & t)
{
	Track = t.Track;
	ProfileList = t.ProfileList;
	Profile = t.Profile;
	Switches = t.Switches;
	Curves = t.Curves;

	Retarders = t.Retarders;
	CtrRetarders = t.CtrRetarders;
	Arresters = t.Arresters;
	Boosters = t.Boosters;
	TrackRetarder = t.TrackRetarder;
	TrackRetarders = t.TrackRetarders;
	Cuts = t.Cuts;

	Season = t.Season;

//	TSetting Setting;

	WeightSensors = t.WeightSensors;
	SpeedSensors = t.SpeedSensors;
//	Circuits = t.Circuits;
//	Controls = t.Controls;
	return *this;
}

bool __fastcall TElements::Initialize(void)
{
	int i, q;
	q = ProfilesList.size();

}

void __fastcall TElements::Import(const TElements & t)
{
	int i, q;
	if (t.Profile.size() > 0)
		Profile = t.Profile;
	q = t.Switches.size();
	for (i = 0; i < q; i++)
		Switches.push_back(t.Switches[i]);
	q = t.Curves.size();
	for (i = 0; i < q; i++)
		Curves.push_back(t.Curves[i]);
	q = t.Retarders.size();
	for (i = 0; i < q; i++)
		Retarders.push_back(t.Retarders[i]);
	q = t.CtrRetarders.size();
	for (i = 0; i < q; i++)
		CtrRetarders.push_back(t.CtrRetarders[i]);
	q = t.Arresters.size();
	for (i = 0; i < q; i++)
		Arresters.push_back(t.Arresters[i]);
	q = t.TrackRetarders.size();
	for (i = 0; i < q; i++)
		TrackRetarders.push_back(t.TrackRetarders[i]);
	q = t.Cuts.size();
	for (i = 0; i < q; i++)
		Cuts.push_back(t.Cuts[i]);
	q = t.Weathers.Items.size();
	for (i = 0; i < q; i++)
		Weathers.Add(t.Weathers.Items[i]);
	return;
}

TProfile __fastcall TElements::GetProfile(const AnsiString SerialNumbers)
{
	for (int i = 0; i < ProfileList.size(); i++) {
		if (ProfileList[i].SerialNumber == SerialNumbers) {
			return ProfileList[i];
		}
	}
	return NULL;
};

TCurves __fastcall TElements::GetCurves(const vector<AnsiString> SerialNumbers)
{
	TCurves Cs;
	for (int i = 0; i < SerialNumbers.size(); i++) {
		for (int j; j < Curves.size(); j++) {
			if (Curves[i].SerialNumber == SerialNumbers[j]) {
				Cs.push_back(Curves[i]);
			}
		}
	}
	return Cs;
};

TSwitches __fastcall TElements::GetSwitches(const vector<AnsiString> SerialNumbers)
{
};
TRetarders __fastcall TElements::GetRetarders(const vector<AnsiString> SerialNumbers);
TCtrRetarders __fastcall TElements::GetCtrRetarders(const vector<AnsiString> SerialNumbers);
TArresters __fastcall TElements::GetArresters(const vector<AnsiString> SerialNumbers);
TTrackRetarders __fastcall TElements::GetTrackRetarders(const vector<AnsiString> SerialNumbers);
TCuts __fastcall TElements::GetCuts(const vector<AnsiString> SerialNumbers);
TWarningMake __fastcall TElements::GetWarningMake(const AnsiString SerialNumbers);
float __fastcall TElements::GetStopPoint(const AnsiString SerialNumbers);
TWeather __fastcall TElements::GetWeather(const AnsiString SerialNumbers);
